package com.lsw.jgyf.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.lsw.Base.BaseHolder;
import com.lsw.Base.BaseSimpleAdapter;
import com.lsw.jgyf.R;
import com.lsw.jgyf.model.StagingCompanyModel;

/**
 * Created by Administrator on 2018/7/11 0011.
 */

public class HomeFragment3Adapter extends BaseSimpleAdapter<StagingCompanyModel> {
    public HomeFragment3Adapter(Context context) {
        super(context);
    }

    @Override
    protected BaseHolder<StagingCompanyModel> getHolder() {
        return new BaseHolder<StagingCompanyModel>() {
            TextView tv_name;
            TextView tv_count;

            @Override
            public void bindViews(View parentView) {
                tv_name = parentView.findViewById(R.id.tv_name);
                tv_count = parentView.findViewById(R.id.tv_count);
            }

            @Override
            public void bindData(StagingCompanyModel item, int position) {
                tv_name.setText(item.getName());
                tv_count.setText(item.getProduct_count() + "");
            }
        };
    }

    @Override
    protected int getLayoutResource() {
        return R.layout.item_home_fragment3;
    }
}
